<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>list</title>
</head>
<script src="https://unpkg.com/vue@3"></script>
<body>

    <div id="app">
        
        <ul>
            <li v-for="book in bookList" :key="id">
                书籍名是{{book.name}}  作者是{{book.author}}
                <button>{{book.id}}</button>
            </li>
            <li v-for="{id,name,author} in bookList" >
                书籍名是{{name}}  作者是{{author}}
                <button>{{id}}</button>
            </li>
        </ul>
       
    </div>
    <script>
        const {createApp} = Vue;
        createApp({
            data:function(){
                return{
                    msg:"hello",
                    bookList:[
                        {id:1,name:"thinking in java",author:"zhangsan"},
                        {id:2,name:"thinking in java1",author:"lisi"},
                        {id:3,name:"thinking in java2",author:"wangwu"},
                ]
                }
            }
        }).mount("#app");
    </script>
</body>
</html>